package com.zyl.blog.common.domain.related.bean;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigInteger;
import java.time.LocalDateTime;

/**
 * @version v1.0
 * @ProjectName: Personal_Blog_Server
 * @Package: com.zyl.blog.common.domain.router.bean
 * @ClassName: RoleRoute
 * @Description: 角色路由关联表
 * @Author FinalFantasy
 * @Date 2025/9/4-08:48
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("role_route")
public class RoleRoute implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    @TableId(value = "id", type = IdType.AUTO)
    @JsonProperty("id")
    private BigInteger id;

    /** 角色ID */
    @TableField("role_id")
    @JsonProperty("roleId")
    private BigInteger roleId;

    /** 路由ID */
    @TableField("route_id")
    @JsonProperty("routeId")
    private BigInteger routeId;

    /** 创建时间（自动生成） */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    @JsonProperty("createdAt")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createdAt;
}
